]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
blur-effect: Don't check whether effect is enabled when painting
authorJonas Dreßler <verdre@v0yd.nl>
Fri, 27 Mar 2020 22:00:36 +0000 (23:00 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 27 Mar 2020 22:31:56 +0000 (22:31 +0000)
A ClutterEffect is being painted as part of the paint cycle of
ClutterActor, where _clutter_effect_paint() is called before painting
the actual actor. With that, it's impossible that an effect gets painted
while it's disabled, so remove the check whether the ClutterActorMeta is
enabled before painting.

Also if everything works fine in Clutter, the ClutterActorMeta should
have an actor set and we've been notified about that actor in
shell_blur_effect_set_actor(), so assert that our cached actor is set
when painting the effect.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1000

src/shell-blur-effect.c

index 2858af7f7305607023154e2f030df055ae1d4f65..cd001f6b3b42112c196130930bcf2587fa31079d 100644 (file)
@@ -681,12 +681,6 @@ update_framebuffers (ShellBlurEffect *self)
   float height = -1;
   float width = -1;
 
-  if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (self)))
-    return FALSE;
-
-  if (!self->actor)
-    return FALSE;
-
   get_target_size (self, &width, &height);
   downscale_factor = calculate_downscale_factor (width, height, self->sigma);
 
@@ -776,6 +770,8 @@ shell_blur_effect_paint (ClutterEffect           *effect,
   ShellBlurEffect *self = SHELL_BLUR_EFFECT (effect);
   uint8_t paint_opacity;
 
+  g_assert (self->actor != NULL);
+
   if (self->sigma > 0)
     {
       if (needs_repaint (self, flags))